// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import Demo from "./components/Demo";
import Test from "./components/Test";
import './assets/css/common.css'
import Events from "./views/Events";
import axios from "axios";

Vue.prototype.$axios = axios
axios.defaults.baseURL = '/api'
axios.defaults.headers.post['Content-Type'] = 'application/json'
//配置全局的超时时长
axios.defaults.timeout = 2000;
//配置全局的基本URL
axios.defaults.baseURL = 'http://localhost:8000';


Vue.config.productionTip = false
// Vue.prototype.$axios=axios

Vue.use(ElementUI);

// Filters 全局注册，方便复用
Vue.filter("to-uppercase",function (value) {
  return value.toUpperCase()
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  axios,
  components: { App,Demo,Test,Events },
  template: '<App/>'
})

// event bus
export const bus = new Vue();
